<?php
/**
 * Created by PhpStorm.
 * User: mohuani
 * Date: 2019/4/13
 * Time: 16:07
 */

/**
 *
 http://wthrcdn.etouch.cn/weather_mini?city=深圳

http://wthrcdn.etouch.cn/weather_mini?citykey=101280601
http://wthrcdn.etouch.cn/weather_mini?citykey=101280601

http://mobile.weather.com.cn/js/cityList.xml

教程文档
https://waylau.com/spring-boot-weather-report/
 */

const ROOT_DIR = __DIR__;

/** 城市列表 */
const WEATHER_CITY_LISTS_XML = "http://mobile.weather.com.cn/js/cityList.xml";

const WEATHER_CITY_LISTS_FILE_XML = ROOT_DIR . '/App/Configs/cityList.xml';
const WEATHER_CITY_LISTS_FILE_JSON = ROOT_DIR . '/App/Configs/cityList.json';

/** 通过cityName获取天气信息 */
const WEATHER_API_BY_CITY_NAME = "http://wthrcdn.etouch.cn/weather_mini?city=";

/** 通过cityKey获取天气信息 */
const WEATHER_API_BY_CITY_KEY = "http://wthrcdn.etouch.cn/weather_mini?citykey=";
const WEATHER_API_OK_STATUS_CODE = 1000;

const WEATHER_INFO_CITY_KEY_REDIS_KEY = "web_weather_info_city_key_";
const WEATHER_INFO_CITY_NAME_REDIS_KEY = "web_weather_info_city_name_";
const WEATHER_INFO_REDIS_EXPIRE_TIME = 30 * 60;  // 天气信息默认的缓存时间30分钟

const REDIS_CONFIG_HOST = '127.0.0.1';
const REDIS_CONFIG_PASSWORD = '';
const REDIS_CONFIG_PORT = 6379;
const REDIS_CONFIG_DB_NAME = 0;
const REDIS_CONFIG_TIMEOUT = 2;
